import requests


def upload(file_name, file_path):
    url = 'https://10.121.110.222/zuul/csam/analyze/isomeryData/fileUpload'

    header = {
        'uid': 'cc41b6e1-9604-4e78-a59d-ab91d7384db6'
    }
    file = {'file': (file_name+'.xlsx',
                     open(file_path, 'rb'),
                     'multipart/form-data; boundary=----WebKitFormBoundary9uCIewqcWegG3mq8')}
    data = {
        'fileName': file_name,
        'businessFactory': '手工录入',
        'securityPolicy': "",
        'organUuid': "c8ba8231-c384-4fc9-b62e-a1c63caf0d86",
        'remarks': ""
    }

    response = requests.post(url, headers=header, data=data, files=file, verify=False)
    return response


if __name__ == '__main__':
    print(upload('qqqqq', r'C:\Users\zxc19\Desktop\dpApiTest\test\zxc.xlsx').text)
